package be.bonamis.umpire.business.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import be.bonamis.umpire.domain.Customer;
import be.bonamis.umpire.domain.Dog2;
import be.bonamis.umpire.repository.CustomerRepository;
import be.bonamis.umpire.repository.Dog2Repository;


@Service
public class CustomerService {

	@Autowired
	private CustomerRepository customerRepository;
	@Autowired
	private Dog2Repository dogRepository;

	@Transactional
	public void importData() {
		List<Dog2> dogs = new ArrayList<Dog2>();
        dogs.add(new Dog2("Terminator"));
        dogs.add(new Dog2("Fluffy"));
        dogs.add(new Dog2("Bacon"));

        Customer customer = new Customer();
        customer.setName("Arnold");
        customer.setDogs(dogs);
        customerRepository.save(customer);
			}
}